<script type="text/javascript">
    $(document).ready(function() {
        $("input,select,textarea").not("[type=submit]").jqBootstrapValidation({
            submitSuccess: function($form, event) {
                event.preventDefault();

                $.ajax({
                    type: "POST",
                    url: "config_process.php",
                    data: $('#main').serialize(),
                    cach: false,
                    error: function() {
                        alert("ERROR !!!!");
                    },
                    success: function(data) {
                        //alert(data);
                        window.location.href = "index.php?pages=config";
                    }
                });

            }
        });
    });
</script>

<?php
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$sql = "SELECT * FROM tbl_config "
        . " WHERE id = '1' ";

$db = new myDBS;
$db->selectDB("account");
$row = $db->fetch_object($db->runSQL($sql));
?>
<div class="panel panel-success">
    <div class="panel-heading">กำหนดค่า</div>
    <div class="panel-body">
        <form id="main" name="main">
            <div class="control-group">
                <label class="control-label">กำหนดวันหมดอายุเช็ค</label>
                <div class="controls ">
                    <input type="text" class="text-right input-mini" id="cheque_expire" name="cheque_expire"  value="<?php echo (isset($row->cheque_expire)) ? $row->cheque_expire : ""; ?>" placeholder="0" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">ประกันสังคม (ร้อยละ)</label>
                <div class="controls ">
                    <input type="text" class="text-right input-mini" id="sso" name="sso"  value="<?php echo (isset($row->sso)) ? $row->sso : ""; ?>" placeholder="0" />
                </div>
            </div>
            <input type="hidden" id="id" name="id" value="<?php echo $row->id; ?>">
            <input type="submit" class="btn btn-info" value="บันทึกค่า">
            <a href="index.php" class="btn">ยกเลิก</a>
        </form>
    </div>
</div>

